person_info = [{"name": "刘备", "age": "45", "title": "蜀国君主"},
               {"name": "张飞", "age": "40", "title": "右将军"},
               {"name": "关羽", "age": "43", "title": "前将军"}]
# 输入查找的名字,若名字能查询的到,打印输出 姓名:刘备,年龄:45,官职:蜀国君主

find_name = input('请输入要查询的名字:')
for i in person_info:
    if find_name == i.get('name'):
        print(f"姓名:{i.get('name')},"f"年龄:{i.get('age')},"f"官职:{i.get('title')}")
        break
else:
    print('查无此人')

